- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 156
           fix: data race on Systray.SetCurrentConfigFile
          #1012
        
          New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…OME and HOME directories
| Codecov ReportAttention: Patch coverage is  
 
 Additional details and impacted files@@            Coverage Diff             @@
##             main    #1012      +/-   ##
==========================================
+ Coverage   20.14%   21.59%   +1.44%     
==========================================
  Files          42       42              
  Lines        3222     3228       +6     
==========================================
+ Hits          649      697      +48     
+ Misses       2488     2442      -46     
- Partials       85       89       +4     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. | 
…e testing that branch
… non-existing config path
…ultConfigAreCopied
Systray.SetCurrentConfigFile
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure which is the difference the configPath is still accessed concurrently by the main thread and in the loop.
| if configPath == nil { | ||
| log.Panic("configPath is nil") | ||
| } | ||
|  | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
configPath should always be not nil, can we avoid the check?
Please check if the PR fulfills these requirements
before creating one)
Fix a data race on the config set to the Systray struct.
When the agent starts, there is a data race on the
SetCurrentConfigFilemethod called by two different go routines.The config is read in the main and the
SetCurrentConfigFileon Systray is called by the main goroutine (and not in the otherloopgo routine)legacybehaviours is not easy (the config.ini file in the old location is copied into the new home location). It relies on theos.Executable()calls